com.supermap.data
Class FieldInfos
- java.lang.Object
-
- com.supermap.data.FieldInfos
-
public class FieldInfos extends java.lang.Object
The FieldInfos class.This class can be created and used alone, all the field information of a vector dataset or recordset is a instance of FieldInfos class. You can also get a object of this class from vector dataset or recordset.
- Example:
- The following codes realize adding operation of the FieldInfos object.
private FieldInfos getFieldInfos() { //???????????,?????????????? FieldInfo fieldinfo = new FieldInfo(); fieldinfo.setCaption("one"); fieldinfo.setName("value"); fieldinfo.setType(FieldType.INT16); fieldinfo.setDefaultValue("10"); //????????????????? FieldInfos fieldinfos = new FieldInfos(); fieldinfos.add(fieldinfo); return fieldinfos; }
-
-
Constructor Summary
Constructors Constructor and Description FieldInfos()
Construct a new FieldInfos object, the count ofFieldInfo
objects in it is 0.FieldInfos(FieldInfo[] fieldInfos)
Creates a new LayersControl object according to the specified arguments.FieldInfos(FieldInfos fieldInfos)
Constructs a new object identical to the given FieldInfos object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
add(FieldInfo fieldInfo)
Add the specified FieldInfo object to the current FieldInfos object.void
dispose()
Disposes the resources occupied by the object.FieldInfo
get(int index)
Returns the specified FieldInfo object in this FieldInfos object.FieldInfo
get(java.lang.String name)
Returns the FieldInfo object with the specified name from the FieldInfos object.int
getCount()
Return the number of elements in the specified FieldInfos.int
indexOf(java.lang.String name)
Gets the index number of the specified FieldInfo object in current FieldInfos.boolean
remove(int index)
Removes the elements with the specified index number from current FeildInfos.boolean
remove(java.lang.String name)
Removes the FieldInfo object with the specified name from current FieldInfos.
-
-
-
Constructor Detail
-
FieldInfos
public FieldInfos()
Construct a new FieldInfos object, the count ofFieldInfo
objects in it is 0.
-
FieldInfos
public FieldInfos(FieldInfo[] fieldInfos)
Creates a new LayersControl object according to the specified arguments.- Parameters:
fieldInfos
- specifiedFieldInfo
class array.
-
FieldInfos
public FieldInfos(FieldInfos fieldInfos)
Constructs a new object identical to the given FieldInfos object.- Parameters:
fieldInfos
- The FieldInfos object specified.
-
-
Method Detail
-
getCount
public int getCount()
Return the number of elements in the specified FieldInfos.- Returns:
- the total count of elements in the specified FieldInfos.
- Default:
- The default value is 0.
-
get
public FieldInfo get(java.lang.String name)
Returns the FieldInfo object with the specified name from the FieldInfos object.- Parameters:
name
- the name of the specified item, that is the name of theFieldInfo
object.- Returns:
- The field information with the given name in the FieldInfo object.
-
get
public FieldInfo get(int index)
Returns the specified FieldInfo object in this FieldInfos object.- Parameters:
index
- the index of the item to return, which starts from 0.- Returns:
- the element with the specified index in the FieldInfos object.
-
add
public int add(FieldInfo fieldInfo)
Add the specified FieldInfo object to the current FieldInfos object.Note: When adding fields, it is needed to set the default value for required fields, the adding will fail if not set the default value.
- Parameters:
fieldInfo
- The field object to add.- Returns:
- fieldInfo The index added to the
FieldInfos
instance.
-
indexOf
public int indexOf(java.lang.String name)
Gets the index number of the specified FieldInfo object in current FieldInfos.- Parameters:
name
- The name of the specified fieldInfo.- Returns:
- The index of the
FieldInfo
object with the name being name in fieldInfos.
-
dispose
public void dispose()
Disposes the resources occupied by the object. After calling this method, this object will not usable.
-
remove
public boolean remove(int index)
Removes the elements with the specified index number from current FeildInfos.- Parameters:
index
- The index of the element to remove.- Returns:
- Return true if success, otherwise return false.
-
remove
public boolean remove(java.lang.String name)
Removes the FieldInfo object with the specified name from current FieldInfos.- Parameters:
name
- The name of the FieldInfo to be removed- Returns:
- Return true if success, otherwise return false
-
-